import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'
import LoginView from '@/views/login/LoginView.vue'
import SignView from '@/views/sign/SignView.vue'
import ShopListView from '@/views/list/ShopListView.vue'
import AddShopView from '@/views/shop-owners/OpenShopView.vue'
import CommodityListView from '@/views/list/CommodityListView.vue'
import AppLayout from '@/layout/AppLayout.vue'
import BillingSystem from '@/views/user/BillingSystem.vue'
import PersonalInformation from '@/views/user/PersonalInformation.vue'
import Shoppingcart from '@/views/customer/Shoppingcart.vue'
import OrdersManage from '@/views/customer/OrdersManage.vue'
import commodityApproval from '@/views/admin/commodityApproval.vue'
import ShopApproval from '@/views/admin/ShopApproval.vue'
import payment from '@/views/pay/payment.vue'
import CommodityManage from '@/views/shop-owners/CommodityManage.vue'
import UpdateCommodity from '@/views/shop-owners/UpdateCommodity.vue'
import TradingVolume from '@/views/shop-owners/TradingVolume.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/manage',
      component: AppLayout,
      children: [
        {
          path: 'login',
          name: '登录',
          component: LoginView
        },
        {
          path: 'shoplist',
          name: '店铺列表',
          component: ShopListView
        },
        {
          path: 'addshop',
          name: '商户开店',
          component: AddShopView
        },
        {
          path: 'BillingSystem',
          name: '账户界面',
          component: BillingSystem
        },
        {
          path: 'PersonalInformation',
          name: '个人信息界面',
          component: PersonalInformation
        },
        {
          path: 'sign',
          name: '注册',
          component: SignView
        },
        {
          path: 'shoppingcart',
          name: '购物车',
          component: Shoppingcart
        },
        {
          path: 'ordersmanage',
          name: '订单管理',
          component: OrdersManage
        },
        {
          path: 'commodityApproval',
          name: '商品审批',
          component: commodityApproval
        },
        {
          path: 'ShopApproval',
          name: '开店审批',
          component: ShopApproval
        },
        {
          path: 'CommodityManage',
          name: '商品管理',
          component: CommodityManage
        },
        {
          path: 'UpdateCommodity',
          name: '上架商品',
          component: UpdateCommodity
        },
        {
          path: 'TradingVolume',
          name: '流水管理',
          component: TradingVolume
        },
      ]
    },
    {
      path: '/',
      name: 'home',
      component: HomeView
    },
    {
      path: '/payment',
      name: '支付界面',
      component: payment
    },
    {
      path: '/CommodityList',
      name: '商品列表',
      component: CommodityListView
    },
  ]
})

export default router
